import {BasicColumn, FormSchema} from '/@/components/Table';
import {commonStatusDict, commonStatusDictMap} from '/@/utils/dict';

export const columns: BasicColumn[] = [
  {
    title: '服务商号',
    dataIndex: 'isvNo',
  },
  {
    title: '服务商名称',
    dataIndex: 'isvName',
  },
  {
    title: '服务商简称',
    dataIndex: 'isvShortName',
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
  },
  {
    title: '状态',
    dataIndex: 'status',
    dictFormat: commonStatusDictMap,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'isvNo',
    label: '服务商号',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    field: 'isvName',
    label: '服务商名称',
    component: 'Input',
    colProps: {span: 6},
  },
  {
    field: 'status',
    label: '状态',
    component: 'Select',
    componentProps: {
      options: commonStatusDict,
    },
    colProps: {span: 6},
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'id',
    label: 'ID',
    component: 'Input',
    show: false,
  },
  {
    field: 'isvName',
    label: '服务商名称',
    component: 'Input',
    required: true,
  },
  {
    field: 'isvShortName',
    label: '服务商简称',
    component: 'Input',
    required: true,
  },
  {
    field: 'contactName',
    label: '联系人姓名',
    component: 'Input',
  },
  {
    field: 'contactTel',
    label: '联系人手机',
    component: 'Input',
  },
  {
    field: 'contactEmail',
    label: '联系人邮箱',
    component: 'Input',
  },
  {
    field: 'status',
    label: '状态',
    component: 'RadioGroup',
    defaultValue: 1,
    componentProps: {
      options: commonStatusDict,
    },
    required: true,
  },
  {
    field: 'remark',
    label: '备注',
    component: 'InputTextArea',
    colProps: {lg: 24, md: 24},
  },
];
